package Dome2;

public class Text2 {
    public static <E extends Comparable<E>>  E Max(E[]arr) {
        E ret = arr[0];
        for (int i = 1; i < arr.length; i++) {
            if (ret.compareTo(arr[i]) < 0) {
                ret = arr[i];
            }
        }
        return ret;
    }

    public static void main(String[] args) {
        Integer[] arr={6,2,3,4,1000,1};
        System.out.println(Max(arr));
    }
}
